/*
 * @Date: 2025-04-29 17:26:16
 * @Auth: 873768511@qq.com
 * @LastEditors: 463997479@qq.com
 * @LastEditTime: 2025-09-15 10:54:55
 * @FilePath: \corpus\src\pages\catalogue\detail\index.tsx
 */

import { PageContainer } from '@ant-design/pro-components';
import { Button, Spin } from 'antd';
import { history } from 'umi';
import BasicInfo from './components/BasicInfo';
import TableData from './components/TableData';
import Container from './hooks';
import styles from './index.less';
function Index() {
  const { detailsData, setModalVisible } = Container.useContainer();
  const { loading } = detailsData;
  const { pathname } = history.location;
  if (loading) {
    return <Spin style={{ width: '100%', height: '100%' }}></Spin>;
  }
  return (
    <PageContainer
      className={styles.detailWrap}
      extra={[
        <Button
          key="0"
          onClick={() => {
            history.go(-1);
          }}
        >
          取消
        </Button>,
      ]}
    >
      <div className={styles.container}>
        <BasicInfo />
        <TableData data={detailsData?.childs} />
      </div>
    </PageContainer>
  );
}

export default () => {
  return (
    <Container.Provider>
      <Index />
    </Container.Provider>
  );
};
